<%--
  Created by IntelliJ IDEA.
  User: 29091
  Date: 2021-12-20
  Time: 8:58
  To change this template use File | Settings | File Templates.
  购物车 页面
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
  <head>
      <title>购物车~花礼网</title>
      <link rel="stylesheet" type="text/css" href="../css/shoppingTrolley.css"/>
      <link rel="stylesheet" type="text/css" href="../css/shoppingTrolley2.css"/>
      <link rel="stylesheet" type="text/css" href="../css/topShoppingTrolley.css"/>
      <script src="../js/jquery-3.6.0.js" type="text/javascript"></script>
      <script src="../js/shoppingTrolley2.js" type="text/javascript"></script>
  </head>
  <body>
    <div id="dingbu">
      <div id="daohang" class="clearfix">
        <ul class="ue clearfix">
          <li>
            <a href="#">
              <span class="tu"></span>收藏花礼网(hua.com)
            </a>
          </li>
          <li id="weixin">
            <a href="#">
              <span class="tu1"></span>关注微信
            </a>
            <div id="displ-weixin">
              <img src="../image/loginImg/wxguanjia_qrcode.png" width="124" height="124">
              <p>
                扫码关注<br>
                回复"礼物"更多惊喜！
              </p>
            </div>
          </li>
          <li id="huali">
            <a href="#">
              <span class="tu2"></span>
              花礼网app
            </a>
            <div id="disp-huali">
              <img src="../image/loginImg/app_download_qrcode.png" width="124" height="124">
              <p>
                新人专享100元APP礼包
              </p>
            </div>
          </li>
        </ul>
        <div id="daohang2">
          <ul class="ur clearfix">
            <li>
              <c:if test="${empty sessionScope.user}">
                <a href="../login.jsp">你好，请登录</a>
                <a href="../zhuce.jsp">注册</a>
              </c:if>
              <c:if test="${not empty sessionScope.user}">
                <a href="../user/UserInfo.shtml">你好，${sessionScope.user.name}</a>
                <a href="../userlogin.shtml?flag=tuiChu" onclick="return confirm('确认退出登录吗？')">退出</a>
              </c:if>
            </li>
            <li class="pipe">|</li>
            <li>
              <a href="#">订单查询</a>
            </li>
            <li class="pipe">|</li>
            <li id="huali2">
              <a href="#">我的花礼</a>
            </li>
            <li class="pipe">|</li>
            <li class="clearfix" id="kefu">
              <a href="#">
                客户服务
              </a>
              <span class="tu4"></span>
              <div id="disp-kefu">
                <a href="#">在线付款</a>
                <a href="#">帮助中心</a>
                <a href="#">售后服务</a>
                <a href="#">配送范围</a>
                <a href="#">留言反馈</a>
              </div>
            </li>
            <li class="pipe">|</li>
            <li id="gouwuche" class="clearfix" >
              <a href="#">
                <span class="tu3"></span>
                购物车
                <span style="color: #FF6A00">(${requestScope.cartNum})</span>
              </a>
              <span class="tu5"></span>
              <div id="disp-gouwuche" class="clearfix">
                  <div class="cargo">
                    <c:forEach items="${userShoppingCart}" var="shoppingTop">
                        <div class="com-list clearfix">
                            <div class="img-box">
                                <a href="#">
                                  <img src="../image/commodity/${shoppingTop.commodity.comImage}" width="50" height="53"/>
                                </a>
                            </div>
                            <div class="title">
                              <a href="#" target="_blank">${shoppingTop.commodity.comName}</a>
                            </div>
                            <div class="num">${shoppingTop.num}</div>
                            <div class="price">
                              <span class="price-sign text-primary">￥</span>
                              <span class="price-num text-primary strong">${shoppingTop.commodity.outPrice}</span>
                            </div>
                        </div>
                    </c:forEach>
                  <div class="settlement clearfix">
                    <div class="total-price">
                      <span><strong class="text-primary">${requestScope.cartNum}</strong> 件总计:</span>
                      <span class="price-sign text-primary strong">￥</span>
                      <span class="price-num text-primary strong">${totalPrice}</span>
                    </div>
                    <a href="#" class="btn btn-primary btn-sm" style="color: #ffffff;">去购物车结算</a>
                  </div>
                </div>
              </div>
            </li>
            <li class="pipe">|</li>
            <li id="menu">
              鲜花礼品网:中国领先的鲜花品牌
            </li>
          </ul>
        </div>
      </div>
    </div>
    <div id="tou" class="clearfix">
      <div style="width: 500px;height: 64px;margin-top: 28px; float: left;"><a href="#" id="log"></a></div>
      <div id="sou"></div>
      <div id="lianxi">
                  <span id="ico-phone">
                      <span id="tu6"></span>
                      400-889-8188
                  </span>
        <a href="#" style="border-top: none;border-right: none;border-bottom: none;border-left: 1px solid rgb(217, 217, 217);border-image: initial;}">
          <span id="tu7"></span>
          在线客服
        </a>
      </div>
    </div>
    <!--内容-->
    <div class="container">
      <!--列表-->
      <div class="cart-panel">
        <div class="hd">
          <ul class="order-title clearfix">
            <li class="selecter"></li>
            <li class="product">商品名称</li>
            <li class="market-price">市场价</li>
            <li class="order-price">订购价</li>
            <li class="num">数量</li>
            <li class="operate">操作</li>
          </ul>
        </div>
        <div class="bd">
          <c:forEach items="${userShoppingCart}" var="shopping">
              <ul class="order-list">
                  <input type="hidden" name="id" value="${shopping.id}">
                  <li class="selecter">
                      <c:if test="${shopping.flag}" var="active">
                          <i class="icon-select active"></i>
                      </c:if>
                      <c:if test="${!active}">
                        <i class="icon-select"></i>
                      </c:if>
                  </li>
                  <li class="img-box">
                      <a href="#"><img src="../image/commodity/${shopping.commodity.comImage}"/></a>
                  </li>
                  <li class="product">
                      <a href="#">
                        <span class="product-title">${shopping.commodity.comName}</span>
                        <span class="feature">
                          <c:if test="${shopping.commodity.distribution != '全国'}">${shopping.commodity.distribution}</c:if>
                        </span>
                      </a>
                  </li>
                  <li class="market-price">
                      <span class="price-sign">￥</span>
                      <span class="price-num">${shopping.commodity.marketPrice}</span>
                  </li>
                  <li class="order-price">
                      <span class="price-sign">￥</span>
                      <span class="price-num">${shopping.commodity.outPrice}</span>
                  </li>
                  <li class="num">
                      <div class="input-num">
                          <c:if test="${shopping.num>1}">
                            <span class="btn btnspan">-</span>
                          </c:if>
                          <c:if test="${shopping.num<=1}">
                            <span class="btn btnspan no">-</span>
                          </c:if>
                          <input type="text" name="cpsl" class="form-control" value="${shopping.num}" maxlength="3"/>
                          <c:if test="${shopping.num>=100}">
                            <span class="btn btnspan no">+</span>
                          </c:if>
                          <c:if test="${shopping.num<100}">
                            <span class="btn btnspan">+</span>
                          </c:if>
                      </div>
                  </li>
                  <li class="operate">
                      <a href="#" class="delBtn">删除</a><br />
                  </li>
              </ul>
          </c:forEach>
        </div>
      </div>
      <div class="set-bar clearfix">
        <div class="set-info clearfix">
          <a href="../index.shtml" class="back" style="width:90px;">
            <span class="ico ico-back"></span>继续挑选
          </a>
          <div class="set-stat">
            应付金额
            <div class="price">
              <span class="price-sign">￥</span>
              <span class="price-num" id="totalMoney">${requestScope.activePrice}</span>
            </div>
          </div>
        </div>
        <button class="btn btn-primary btn-lg" type="button" id="jiesuan">去结算</button>
      </div>
      <div class="cart-tabs-wrap">
        <ul class="cart-tabs">
          <li class="active">
            <a href="javascript:;">购买该商品的还购买了</a>
          </li>
        </ul>
        <div class="tab-content">
          <!-- 内容 -->
          <div class="tab-pane" id="likePane">
            <div class="owl-carousel1 clearfix">
              <%--<div class="grid-item">
                <div class="grid-panel">
                  <div class="img-box">
                    <a href="/product/1207009.html" target="_blank">
                      <img src="shoppingTrolleyImg/1207009.jpg">
                    </a>
                  </div>
                  <div class="info-cont">
                    <div class="title">
                      <a href="/product/1207009.html" target="_blank">顺丰包邮/巧克巧蔻定制9粒装手工夹心巧克力一手工夹心巧克力</a>
                    </div>
                    <div class="price">
                      <span class="price-sign">¥</span>
                      <span class="price-num">162</span>
                    </div>
                    <div class="operate">
                      <a href="/shopping/AddtoCart/?product_code=1207009" class="add-cart">加入购物车</a>
                    </div>
                  </div>
                </div>
              </div>--%>



            </div>
          </div>
          <div class="owl-buttons">
            <div class="owl-prev"></div>
            <div class="owl-next"></div>
          </div>
        </div>
      </div>
    </div>
    <%--发送ajax请求 获取商品信息 用于加入购物车--%>
    <script type="text/javascript">
        $(function(){
          $.post("../randomCommoditys.shtml",{"number":8},function(result){
              var data = eval("("+result+")");
              $(data).each(function(i,e){
                  $(".owl-carousel1").append("\
                          <div class='grid-item'>\
                              <div class='grid-panel'>\
                                    <div class='img-box'>\
                                        <a href='../commodityDetails.shtml?id="+e.id+"' target='_blank'>\
                                            <img src='../image/commodity/"+e.comImage+"'>\
                                        </a>\
                                    </div>\
                                    <div class='info-cont'>\
                                        <div class='title'>\
                                            <a href='../commodityDetails.shtml?id="+e.id+"' target='_blank'>"+e.comName+"</a>\
                                        </div>\
                                        <div class='price'>\
                                            <span class='price-sign'>¥</span>\
                                            <span class='price-num'>"+e.outPrice+"</span>\
                                        </div>\
                                        <div class='operate'>\
                                            <a href='clickAddShopping.shtml?id="+e.id+"' class='add-cart'>加入购物车</a>\
                                        </div>\
                                    </div>\
                              </div>\
                          </div>");
              });
          });
        });
    </script>
    <div class="cart-server">
      <div class="toper-server clearfix">
        <ul class="clearfix">
          <li>
            <span class="ico ico-server-o1"></span>
            <h4>鲜花电商龙头</h4>
            <p>销量领先，权威认证龙头企业</p>
          </li>
          <li>
            <span class="ico ico-server-o2"></span>
            <h4>15年品牌 真实口碑</h4>
            <a href="/productpj/"><p>最近评价<font id="pjCount"></font>条</p></a>
          </li>
          <li>
            <span class="ico ico-server-o3"></span>
            <h4>鲜花送前实拍展示</h4>
            <p>展现送前实拍的鲜花网</p>
          </li>
          <li>
            <span class="ico ico-server-o4"></span>
            <h4>3小时送达</h4>
            <p>全国连锁，3小时送2000城市</p>
          </li>
        </ul>
      </div>
    </div>
    <!-- 底部 -->
    <div id="yejiao">
      <a href="#">首页</a>
      <b>|</b>
      <a href="#">关于我们</a>
      <b>|</b>
      <a href="#">媒体报道</a>
      <b>|</b>
      <a href="#">联系方式</a>
      <b>|</b>
      <a href="#">企业团购</a>
      <b>|</b>
      <a href="#">花店入驻</a>
      <b>|</b>
      <a href="#">友情链接</a>
      <b>|</b>
      <a href="#">在线补款</a>
      <b>|</b>
      <a href="#">为什么选择花礼网</a>
    </div>
    <div id="tibu">
      <div id="ach">
        <img src="../image/shoppingTrolleyImg/cxwz.gif" >
        <a href="#"><img src="../image/shoppingTrolleyImg/smyz.gif"></a>
        <a href="#"><img src="../image/shoppingTrolleyImg/6-5.png"></a>
        <a href="#"><img src="../image/shoppingTrolleyImg/zfb.gif"></a>
        <a href="#"><img src="../image/shoppingTrolleyImg/6-7.jpg"></a>
      </div>
      <p>
        <a href="#">中国花卉协会会员</a>
        <a href="#">中国电子商务协会会员</a>
        ICP经营许可证：
        <a href="#">粤B2-20050744</a>
        <b>|</b>
        <a href="#">粤ICP备09171662号</a>
        粤公网安备44030502000373号 Copyright © 2005-2021
      </p>
      <p>
        <a href="#">www.hua.com</a>
        花礼网（鲜花礼品网）-永生花专区
      </p>
    </div>
  </body>
</html>
